/*************************************************************************
	> File Name: config.h
	> Author: Maureen 
	> Mail: 1437867946@qq.com 
	> Created Time: Sat 27 Mar 2021 06:20:42 PM CST
 ************************************************************************/

#ifndef _CONFIG_H
#define _CONFIG_H
struct TimeAndType {
    int time;
    int type;
};

//脚本运行的间隔时间
struct InterTime { 
    struct TimeAndType cpu;
    struct TimeAndType  mem;
    struct TimeAndType disk;
    struct TimeAndType  proc;
    struct TimeAndType sys;
    struct TimeAndType user;

};

//结构体保存配置信息
struct Config {
    char master_ip[20];
    int master_port;
    struct InterTime inter_time;
    int worker_size; //线程个数
};

int init_config(struct Config *config);
int get_config(const char *file, struct Config *config);//读取配置文件，填充结构体

#endif
